//
//  SessionConfig.m
//  DemoApplication
//
//  Created by chris on 15/11/1.
//  Copyright © 2015年 chris. All rights reserved.
//

#import "LFTMCSessionConfig.h"
#import "NIMMediaItem.h"
#import "LFTMCCellLayoutConfig.h"
#import "UIImage+NIM.h"

@implementation LFTMCSessionConfig

- (NSArray<NSNumber *> *)inputBarItemTypes{
    return @[
             @(NIMInputBarItemTypeVoice),
             @(NIMInputBarItemTypeTextAndRecord),
             @(NIMInputBarItemTypeEmoticon),
             @(NIMInputBarItemTypeMore)
             ];
}

- (NSArray *)mediaItems
{
    return @[[NIMMediaItem item:@"onTapMediaItemPicture:"
                    normalImage:[UIImage nim_imageInKit:@"LFTMC_Picture"]
                  selectedImage:[UIImage nim_imageInKit:@"LFTMC_Picture"]
                          title:@"相册"],
             
             [NIMMediaItem item:@"onTapMediaItemShoot:"
                    normalImage:[UIImage nim_imageInKit:@"LFTMC_Camera"]
                  selectedImage:[UIImage nim_imageInKit:@"LFTMC_Camera"]
                          title:@"拍摄"],

             ];
}

- (BOOL)shouldHandleReceiptForMessage:(NIMMessage *)message
{
    //文字，语音，图片和自定义消息支持已读回执，其他的不支持
    NIMMessageType type = message.messageType;
    if (type == NIMMessageTypeCustom) {
        NIMCustomObject *object = (NIMCustomObject *)message.messageObject;
        id attachment = object.attachment;
        
    }
    
    return type == NIMMessageTypeText ||
           type == NIMMessageTypeAudio ||
           type == NIMMessageTypeImage ||
           type == NIMMessageTypeCustom;
}

- (BOOL)disableCharlet
{
    return YES;
}

- (BOOL)shouldHandleReceipt{
    return YES;
}

@end
